﻿//using System;
//using System.ServiceModel;
//using Lari.Framework.Exceptions.DataContract;
//using Lari.Framework.Exceptions.Message;
//using Lari.Framework.Exceptions;


//namespace Lari.Services.Utility
//{
//    public static class LariFaultProvider
//    {

            

//        public static FaultException<LariFault> ToFaultException(int id, Exception ex, bool exposeInnerException)
//        {
//            LariFault sf = new LariFault();
//            if (exposeInnerException == true && ex is LariException)
//            {
//                sf.Id = ((LariException)ex).Id;
//                sf.CustomMessage = ex.Message;
//            }
//            else
//            {
//                sf.Id = id;
//                sf.CustomMessage = XMLMessaage.Message(sf.Id);
//            }


//            Type t = (ex is LariException) ? ex.GetType() : typeof(LariException);
//            FaultCode code = new FaultCode(t.FullName, t.Assembly.FullName);
//            FaultException<LariFault> newFault = new FaultException<LariFault>(sf, ex.Message, code);
//            return newFault;
//        }


//    }



//}
